/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elektra;

/**
 *
 * @author adee
 */
public class EmotionEngine {
    private float happyness;
    
    
    public EmotionEngine(){
        this.happyness=0;
    }
    
    public String mutateMessage(String message, String respond){
        
        this.happyness++;
        if (message.contains(":)")) this.happyness+=3;
        if (message.contains(":D")) this.happyness+=6;
        if (message.contains(":(")) this.happyness=-2;
        
        
        StringBuilder builder = new StringBuilder(respond);
        
        if (this.happyness>0&&this.happyness<6){
          builder.append(" :)");
        }
        
        if (this.happyness>6&&this.happyness<10){
          builder.append(" :D");
        }
        if (this.happyness>10){
          builder.append(" :D :D");
        }
        
        
        if (this.happyness<0){
          builder.append(" :(");
        }
        
        return builder.toString();
    }
}
